package com.smc.hotfixdemo.utils;

import android.content.Context;
import android.content.pm.PackageManager;

public class PermissionsUtil {

    public static boolean checkPermissions(Context context, String[] permissons){
        PackageManager pm = context.getPackageManager();
        String packageName = context.getPackageName();
        boolean bGranted = true;
        for (String permisson : permissons) {
            bGranted &= (pm.checkPermission(permisson, packageName) ==
                    PackageManager.PERMISSION_GRANTED);
        }
        return bGranted;
    }

}
